# Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-ui-extras
pkgver=0.6.2
pkgrel=0
pkgdesc='Misc Lomiri UI QML components'
arch="all"
url="https://gitlab.com/ubports/development/core/lomiri-ui-extras"
license="GPL-3.0-only"
makedepends="
	cmake-extras
	cups-dev
	exiv2-dev
	linux-pam-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	samurai
	"
checkdepends="
	bash
	dbus-test-runner
	diffutils
	grep
	xvfb-run
	"
source="https://gitlab.com/ubports/development/core/lomiri-ui-extras/-/archive/$pkgver/lomiri-ui-extras-$pkgver.tar.gz
	0001-Update-exiv2-includes.patch
	0002-Update-exiv2-includes.patch
	0003-Update-exiv2-includes.patch
	0004-Disable-tst_printers-unittest.patch
	"
subpackages="$pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f687720d98d16e4f043d78d199430b91073f512ef2ed34079ad1ec89452c4b9496941d8c0c5670114694572b4e04420f80d43d1108731013e7f3dd6eeae66422  lomiri-ui-extras-0.6.2.tar.gz
890e1bccd37238a1fb2cf0d858178c917305ec9d23a687ef415a6507264f21c0755e56860ed21486c26c00dc96fca0520c65b2323dc958c1fb669221aa338e29  0001-Update-exiv2-includes.patch
84163e1bb4e41103763f208b1a9131fa9dab8ba13296e4fa8337f3064297632a0ef66d9c7f35f0365b88d1a4acce2fcec79d2c43a0c8dab896950c41a564753b  0002-Update-exiv2-includes.patch
dd5ba840a9654be5b102f1ce8739f86d1fc7123b083229e5906aead9dc4f1ad9b2f0648f9dfe49fcf5fe31321a7f0669e510cb390a691a31b5a0fc39d7924efc  0003-Update-exiv2-includes.patch
888a089cc548e2904a7c787d33edc24a1b140cc0371591594f6851dac7bccc62a07a32eab30d271421f4d9593d0490aaf57cd824883470ede4b44980f6bda997  0004-Disable-tst_printers-unittest.patch
"
